﻿using SD.Infrastructure.EntityBase;
using System;

namespace SlamDunk.MES.Domain.Entities.PlanContxt
{
    /// <summary>
    /// 销售订单明细
    /// </summary>
    public class SaleOrderDetail : PlainEntity, ISortable
    {
        #region # 构造器

        #region 00.无参构造器
        /// <summary>
        /// 无参构造器
        /// </summary>
        protected SaleOrderDetail() { }
        #endregion

        #region 01.创建销售订单明细构造器
        /// <summary>
        /// 创建销售订单明细构造器
        /// </summary>
        /// <param name="productId">产品Id</param>
        /// <param name="quantity">数量</param>
        /// <param name="productionBatchNo">生产批号</param>
        /// <param name="sort">排序</param>
        /// <param name="description">描述</param>
        public SaleOrderDetail(Guid productId, decimal quantity, string productionBatchNo, int sort, string description)
            : this()
        {
            this.ProductId = productId;
            this.Quantity = quantity;
            this.ProductionBatchNo = productionBatchNo;
            this.Sort = sort;
            this.Description = description;
        }
        #endregion

        #endregion

        #region # 属性

        #region 产品Id —— Guid ProductId
        /// <summary>
        /// 产品Id
        /// </summary>
        public Guid ProductId { get; private set; }
        #endregion

        #region 数量 —— decimal Quantity
        /// <summary>
        /// 数量
        /// </summary>
        public decimal Quantity { get; private set; }
        #endregion

        #region 生产批号 —— string ProductionBatchNo
        /// <summary>
        /// 生产批号
        /// </summary>
        public string ProductionBatchNo { get; private set; }
        #endregion

        #region 排序 —— int Sort
        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; private set; }
        #endregion

        #region 描述 —— string Description
        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; private set; }
        #endregion

        #region 导航属性 - 销售订单 —— SaleOrder SaleOrder
        /// <summary>
        /// 导航属性 - 销售订单
        /// </summary>
        public virtual SaleOrder SaleOrder { get; internal set; }
        #endregion

        #endregion
    }
}
